//
//  WKWebViewEx.swift
//  
//
//  Created by tank on 2021/11/16.
//

import Foundation
import WebKit

open class WKWebViewEx: WKWebView {

    public static let processPool = WKProcessPool()


    public init(frame: CGRect = .zero) {

        let configuration: WKWebViewConfiguration = WKWebViewConfiguration()
        configuration.processPool = WKWebViewEx.processPool
        configuration.userContentController.add(AppScriptMessageHandler(), name: AppScriptMessageHandler.key)

        super.init(frame: frame, configuration: configuration)
    }

    public required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
}
